package com.tebiecloud.base.server.controller.feign;

import com.tebiecloud.base.client.model.AuthorityResource;
import com.tebiecloud.base.client.service.IBaseAuthorityServiceClient;
import com.tebiecloud.base.server.service.BaseAuthorityService;
import com.tebiecloud.common.model.ResultBody;
import com.tebiecloud.common.utils.ResultBodyUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 系统权限
 * @Author: tebie
 * @Date: 2019-08-08 17:50
 */
@RestController
@RequestMapping("/feign/authority")
public class AuthorityController implements IBaseAuthorityServiceClient {

    @Autowired
    private BaseAuthorityService baseAuthorityService;

    /**
     * 获取所有访问权限列表
     * @return
     */
    @GetMapping("listauthorityresource")
    @Override
    public ResultBody<List<AuthorityResource>> getAuthorityResourceList() {
        List<AuthorityResource> result = baseAuthorityService.getAuthorityResourceList();
        return ResultBodyUtils.ok(result);
    }

}
